<?php

namespace App\Http\Controllers\Common;

use App\Http\Controllers\Controller;
use App\Models\Delivery;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

//取货地址
class DeliveryController extends Controller
{
    //返回某城市的收货地址
    function deliveries(Request $request) {
        $where = [];
        if ($city = $request->get('city')) {
            $where[] = ['city' , 'like', $city . '%'];
        }
        $deliveries = Delivery::where($where)->get()->toArray();
        return $this->response(0,$deliveries);
    }
}
